﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HTDAL.HTSPC_DBDataSetTableAdapters;

namespace HTspcAppProject
{
    public partial class WarForm : Form
    {
        string DevNm;
        public WarForm(int device_num,string devNm)
        {
            InitializeComponent();

            label_title.Text = devNm + "  报警历史记录";
            DevNm = devNm;
        }

        private void dgvRefresh()
        {
            ht_WarLogTableAdapter warTa = new ht_WarLogTableAdapter();
            DataTable erroDt = warTa.GetDataByDevNmTop20(DevNm);
            dgvErroLog.AutoGenerateColumns = false;
            dgvErroLog.DataSource = erroDt;
            KeyidColumn.DataPropertyName = "keyid";
            war_date.DataPropertyName = "dt";
            war_time.DataPropertyName = "dt";
            war_content.DataPropertyName = "info";
            war_reason.DataPropertyName = "reason";
            SolColumn.DataPropertyName = "sol";
            StColumn.DataPropertyName = "st";
        }

        private void WarForm_Load(object sender, EventArgs e)
        {
            dgvRefresh();
        }
    }
}
